import {request} from "@/utils/request/request";

/**
 *  任务计划单
 */
export class TaskPlanApi {

    /**
     *  分页查询
     */
    static page(data) {
        return request({
            url: '/taskPlanApi/page',
            method: 'get',
            data: data
        })
    }

    /**
     *  新增
     */
    static add(data) {
        return request({
            url: '/taskPlanApi/add',
            method: 'post',
            data: data
        })
    }

    /**
     *  编辑
     */
    static edit(data) {
        return request({
            url: '/taskPlanApi/edit',
            method: 'post',
            data: data
        })
    }

    /**
     *  详情
     */
    static detail(data) {
        return request({
            url: '/taskPlanApi/detail',
            method: 'get',
            data: data
        })
    }

    /**
     *  删除
     */
    static delete(data) {
        return request({
            url: '/taskPlanApi/delete',
            method: 'post',
            data: data
        })
    }

    /**
     *  确认任务
     */
    static confirmTask(data) {
        return request({
            url: '/taskPlanApi/confirmTask',
            method: 'post',
            data: data
        })
    }

    /**
     *  确认出车
     */
    static departure(data) {
        return request({
            url: '/taskPlanApi/departure',
            method: 'post',
            data: data
        })
    }

    /**
     *  查询医疗机构
     */
    static medicalInstitution(data) {
        return request({
            url: '/taskPlanMedicalInstitutionApi/page',
            method: 'get',
            data: {...data, pageSize: 99999999}
        })
    }

    /**
     *  查询医疗机构详情
     */
    static medicalOrderDetail(data) {
        return request({
            url: '/medicalWasteTransferRecordApi/medicalOrderDetail',
            method: 'get',
            data: data
        })
    }

    /**
     *  查询转移联单
     */
    static medicalWasteTransfer(data) {
        return request({
            url: '/medicalWasteTransferRecordApi/page',
            method: 'get',
            data: {...data, pageSize: 99999999}
        })
    }

    /**
     *  查询转移联单详情
     */
    static medicalWasteTransferDetail(data) {
        return request({
            url: '/medicalWasteTransferRecordApi/detail',
            method: 'get',
            data: data
        })
    }

    /**
     *  确认收运
     */
    static receiveAdd(data) {
        return request({
            url: '/medicalWasteTransferRecordApi/receiveAdd',
            method: 'post',
            data: data
        })
    }

    /**
     *  收运异常
     */
    static abnormal(data) {
        return request({
            url: '/medicalWasteTransferRecordApi/abnormal',
            method: 'post',
            data: data
        })
    }

    /**
     *  任务计划-车辆列表
     */
    static taskPlanVehicleList(data) {
        return request({
            url: '/taskPlanVehicleApi/list',
            method: 'get',
            data: data
        })
    }

    /**
     *  任务计划-驾驶员列表
     */
    static taskPlanDriverList(data) {
        return request({
            url: '/taskPlanDriverApi/list',
            method: 'get',
            data: data
        })
    }

    /**
     *  任务计划-装卸员列表
     */
    static taskLoUnPersonnelList(data) {
        return request({
            url: '/taskPlanLoUnPersonnelApi/list',
            method: 'get',
            data: data
        })
    }

    /**
     * 确认回厂
     */
    static returnFactory(data) {
        return request({
            url: '/taskPlanReturnFactoryApi/returnFactory',
            method: 'post',
            data: data
        })
    }

    /**
     * 任务完成查询默认数据
     */
    static completeTaskDefaultData(data) {
        return request({
            url: '/taskPlanApi/queryCompleteTaskDefaultData',
            method: 'get',
            data: data
        })
    }

    /**
     * 任务完成
     */
    static completeTask(data) {
        return request({
            url: '/taskPlanApi/completeTask',
            method: 'post',
            data: data
        })
    }

// 文件上传

    static uploadTask(data) {
        return request({
            url: '/sysFileInfo/upload',
            method: 'post',
            data: data
        })
    }

    /**
     *  获取处置单位
     * @returns {Promise | Promise<unknown>}
     */
    static electronicFence() {
        return request({
            url: '/ctApi/disposalUnitApi/electronicFence',
            method: 'get'
        })
    }

    /**
     *  确认作废
     * @returns {Promise | Promise<unknown>}
     */
    static medicalWasteTransferRecordApiInvalid(params) {
        return request({
            url: '/medicalWasteTransferRecordApi/invalid',
            method: 'post',
            data: params
        })
    }

}